package com.code.translate.function;

import java.io.File;
import java.io.InputStream;
import java.util.Map;

/**
 * @author ggh
 * @date 2022/8/11
 * 图片翻译
 */
public abstract class ImageTranslatePlugin extends TextTranslatePlugin {

    public String translateImage(File image) throws Exception {
        Map<String, Object> params = this.prepareImage();
        return this.doTranslateImage(image, params);
    }

    public String translateImageByStream(InputStream inputStream) throws Exception {
        Map<String, Object> params = this.prepareImage();
        return this.doTranslateImageByStream(inputStream, params);
    }

    protected abstract Map<String, Object> prepareImage() throws Exception;

    protected abstract String doTranslateImage(File image, Map<String, Object> params) throws Exception;

    public String doTranslateImageByStream(InputStream inputStream, Map<String, Object> params) throws Exception {
        return null;
    }

    @Override
    protected Map<String, Object> prepare() throws Exception {
        return null;
    }

    @Override
    protected String doTranslate(String text, Map<String, Object> params) throws Exception {
        return null;
    }
}
